﻿@{
    ViewBag.Title = "AddRole";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
@model RoleModel
<div style="text-align: center; color: red">@TempData["Result"]</div>
<div class="row-fluid" style="margin-top: 10px">
    <div class="span24 span-first">
        <form class="form-horizontal" method="post" action="/Admin/RoleManage/EditRole">
            @Html.HiddenFor(x=>x.Entity.ID)
            <div class="control-group">
                <label class="control-label" style="width: 100px"><s>*</s>角色类型：</label>
                <div class="controls">
                    <div id="RoleType" style="width: 350px">
                        @Html.HiddenFor(x => x.Entity.RoleType)
                    </div>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" style="width: 100px"><s>*</s>角色名称：</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.Entity.RoleName, new { datarules = "{required:true}", style = "width:350px" })
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" style="width: 100px">积分：</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.Entity.Integral, new { datarules = "{required:true}", style = "width:350px" })
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" style="height: 80px; width: 100px">描述：</label>
                <div class="controls" style="height: 80px;">
                    @Html.TextAreaFor(x => x.Entity.RoleDesc, new { datarules = "{required:true}", style = "width:350px" })
                </div>
            </div>
            <hr>
            <div id="submitDiv" style="text-align: center">
                <button id="submitBtn" class="button button-primary" type="submit">提交</button>
                <button class="button" type="reset" onclick="parent.CloseWin()">取消</button>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    var Select = BUI.Select;
    var data = eval('@Html.Raw(Model.RoleTypeList)');
    var select = new Select.Select({
        render: '#RoleType',
        value: "",
        width: '360',
        items: data,
        //forceFit: false, //不强迫列表跟选择器宽度一致
        valueField: '#Entity_RoleType'
    });
    select.render();
</script>
